package com.airy.highSpeed.service.impl;


import com.airy.highSpeed.dao.mysql.ExpresswayInfDao;
import com.airy.highSpeed.dao.oracle.RktxDao;
import com.airy.highSpeed.entity.ExpresswayInfEntity;
import com.airy.highSpeed.entity.RktxEntity;
import com.airy.highSpeed.service.ExpresswayInfService;
import com.airy.highSpeed.service.RktxService;
import com.airy.highSpeed.utils.PageUtils;
import com.airy.highSpeed.utils.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("expresswayInfService")
public class ExpresswayInfServiceImpl extends ServiceImpl<ExpresswayInfDao, ExpresswayInfEntity> implements ExpresswayInfService {

    @Autowired
    ExpresswayInfDao expresswayInfDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        IPage<ExpresswayInfEntity> page = this.page(
                new Query<ExpresswayInfEntity>().getPage(params),
                new QueryWrapper<ExpresswayInfEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ExpresswayInfEntity> findAll() {
        return expresswayInfDao.findAll();
    }

    @Override
    public List<String> findTollStationIdNotNull() {
        return expresswayInfDao.findTollStationIdNotNull();
    }

    @Override
    public void updateByTollStationId(ExpresswayInfEntity expresswayInfEntity) {
        expresswayInfDao.updateByTollStationId(expresswayInfEntity);
    }

    @Override
    public ExpresswayInfEntity findExpresswayInfByTollStationId(String tollStationId) {
        return expresswayInfDao.findExpresswayInfByTollStationId(tollStationId);
    }

}